package com.itheima.service.Impl;

import com.itheima.mapper.ShopMapper;
import com.itheima.pojo.Shop;
import com.itheima.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopServiceImpl implements ShopService {
    @Autowired
    private ShopMapper shopMapper;


    @Override
    public List<Shop> list() {
  List<Shop> shopList =  shopMapper.list();
        return shopList;
    }

    @Override
    public void addShop(Shop shop) {
        shopMapper.addShop(shop);
    }

    @Override
    public void deleteById(Integer id) {
        shopMapper.deleteById(id);
    }

    @Override
    public Shop getById(Integer id) {
        Shop shop=shopMapper.getById(id);
        return  shop;
    }

    @Override
    public void update(Shop shop) {
        shopMapper.update(shop);
    }

    @Override
    public List<Shop> getListById(Integer uId) {
        return shopMapper.getListById(uId);
    }
}
